
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>退款/退货-我的订单</title>
    {include file="public/head" /}
<body class="ofh">
<div class="mfc myorder-list fl">
    <div class="cell">
        <div class="myorder-list-place">
            <div class="head">
                <p class="bsilk">
                    <span>退款商品</span>
                </p>
            </div>

            {volist name="data.OrderGoods" id="vo2"}
            <div class="infor">
                <div class="icon">
                    <div class="sicon"><img src="{$vo2.single_pic}"></div>
                </div>
                <div class="info">
                    <p class="lh30">{$vo2.title}<span class="fa fa-cny fr lh30 c-red">{$vo2.price}</span></p>
                    <p class="tags"><span class="ray">{$vo2.attr_values}</span><span class="fr fa fa-times"> {$vo2.number}</span></p>
                </div>
            </div>
            {/volist}
        </div>
    </div>
</div>
<div class="mfc bsilk2 fl"></div>
<div class="mfc myorder-cancel gap fl">
    <div class="myorder-cancel-type">
        <a class="box" id="chufa2">
            <p class="">我要退款（无需退货）</p>
            <p class="imark">没有收到货，已与卖家协商</p>
            <span class="fa fa-angle-right fa-lg pabs-r-box c-gray"></span>
        </a>
        <a class="box" id="chufa">
            <p class="">我要退款退货</p>
            <p class="imark">已收到货，需要退还收到的货物</p>
            <span class="fa fa-angle-right fa-lg pabs-r-box c-gray"></span>
        </a>
    </div>
</div>
<div class="mfc myorder-cancel gap fl">
    <div class="myorder-cancel-type">
        <div class="box">
            <span class="lh30">货物状态</span><span class="lh30 fr">{$data.status_text}</span>
        </div>
<!--        <div class="box">-->
<!--            <p class="lh30">退款金额</p>-->
<!--            <p class="c-red"><span class="fa fa-cny"></span> <span class="fs12">1560</span></p>-->
<!--        </div>-->
    </div>
</div>
<!--<div class="mfc myorder-cancel gap fl">-->
<!--    <div class="myorder-cancel-option">-->
<!--        <button class="btnbox">提交</button>-->
<!--    </div>-->
<!--</div>-->
<div id="box12345" class="Tbox">
    <div class="mask ACT" act_v="body:ofh|.Tbox:active"></div>
    <div class="show">
        <div class="myorder-cancel-no">
            <h4>请填写退款金额：</h4>
            <input type="number" name="tui_price">

            <div class="gap"><button class="btnbox" onclick="tuikuan({$data.id})">确认</button></div>
        </div>
    </div>
</div>
<div id="box1234" class="Tbox">
    <div class="mask ACT" act_v="body:ofh|.Tbox:active"></div>
    <div class="show">
        <div class="myorder-cancel-no">
            <h4>请填写寄回商品的快递和运单号：</h4>
            <input type="text" name="tui_ydh">
            <p class="c-gray gap">在商家收到商品确认无误后48小时内退款</p>
            <div class="gap"><button class="btnbox" onclick="tuihuo({$data.id})">确认</button></div>
        </div>
    </div>
</div>
</body>
</html>
<script>
    function tuikuan(order_id) {
        var tui_price = $('[name="tui_price"]').val();


        $.ajax({
            type: "POST", //用POST方式传输
            dataType: "json", //数据格式:JSON
            data: {order_id: order_id, tui_price: tui_price},
            url: "{:url('Order/tui_price')}", //目标地址
            async: false,
            success: function (ret) {
                if(ret.code == 200){
                    history.go(-1);
                }else{
                    layer.msg(ret.message);
                }
            }
        });
    }
    $('#chufa').click(function () {
        var has_class = $('#box1234').hasClass('active');

        if(has_class){
            $('#box1234').removeClass('active');
        }else{
            $('#box1234').addClass('active');

        }

    });

    $('#chufa2').click(function () {
        var has_class = $('#box12345').hasClass('active');

        if(has_class){
            $('#box12345').removeClass('active');
        }else{
            $('#box12345').addClass('active');

        }

    });
</script>